POV-Ray : Newsgroups : povray.unofficial.patches : Displacement mapping using isosurfaces : Re: Displacement mapping using isosurfaces Server Time
2 Sep 2024 08:13:13 EDT (-0400)
  Re: Displacement mapping using isosurfaces  
From: Mark Wagner
Date: 12 Apr 2000 01:09:58
Message: <38f40526@news.povray.org>
Pabs wrote in message <38F3D600.A087CAF2@hotmail.com>...
>"Mr. Art" wrote:
>
>> This short bit of code shows how to use a
>> planetary image as a displacement map on a sphere.
>> I know that this is displacement mapping only on a
>> sphere, but the same concept should work on other shapes.
>> I hope that this helps.
>
>I was thinking more along the lines of a patch which used isosurfaces to
>implement displacement mapping


How about the following code:

#declare AnObject = union{
    sphere{<0,0,0>,1}
    torus{1.3,0.5}
}

#declare AnObjectFunc = pigment{
    object{
        AnObject
    }
    color rgb 0, color rgb 1
}

isosurface{
    function{AnObjectFunc+noise3d(x,y,z)}
    contained_by{box{min_extent(AnObject),max_extent(AnObject)}
    method 2
    max_gradient 100
    pigment{rgb 1}
}

I can't guarentee that this will work on the first try, but it will displace
the surface of any object using the noise3d function.  To use a different
object, just replace AnObject with the object you want.

Mark


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.